﻿using Customer.Domain;
using Customer.Infrstructre.ProcurementManager;
using Customer.Read.API.Applcation.Command.ProcurementCommand;
using MediatR;

namespace Customer.Read.API.Applcation.CommandHandlers.ProcurementCommandHandler
{
    public class ProcureProductSelCommandHandler : IRequestHandler<ProcureProductSelCommand, List<ProcureProduct>>
    {
        IProcureProductRepository ppRep;

        public ProcureProductSelCommandHandler(IProcureProductRepository ppRep)
        {
            this.ppRep = ppRep;
        }

        public async Task<List<ProcureProduct>> Handle(ProcureProductSelCommand request, CancellationToken cancellationToken)
        {
            return await ppRep.GetAllAsync();
        }
    }
}
